package org.sport.repository;

import org.sport.model.entityModel.GrouplinkuserEntity;
import org.sport.model.entityModel.GrouptableEntity;
import org.sport.model.entityModel.UsertableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
public interface GroupLinkUserRepository extends JpaRepository<GrouplinkuserEntity,Integer> {






    @Transactional
    @Query("select glu from GrouplinkuserEntity glu where glu.grouptableByGroupId =?1")
    public List<GrouplinkuserEntity> findGPByGId(GrouptableEntity groupId);



    @Transactional
    @Query("select glu from GrouplinkuserEntity glu where glu.usertableByUserId =?1")
    public List<GrouplinkuserEntity> findGByUserId(UsertableEntity userId);
}
